C. Logical operator

D. Relational operator

Q34: What would be the output of function1 and function2?

// SPDX-License-Identifier: SOME IDENTIFIER

pragma solidity ^0.8.10;

contract LogicalContract {

function function1() public pure returns(bool) {

return true && true || false;

}

function function2() public pure returns(bool) {

return false && true || false;

}

}

A. true, true

B. true, false

C. false, true

D. false, false

Q35: What would be the output of function1 and function2?

// SPDX-License-Identifier: SOME IDENTIFIER

pragma solidity ^0.8.10;

contract AnotherLogicalContract {

uint a = 10;

uint b = 2;

function function1() public returns(bool) {

return (++a)*b > a*(b++);

}

function function2() public returns(bool) {

return a*(++b) > (++a)*b;

}